{% extends "projects/base_project.html" %}

{% load i18n %}
{% load static %}

{% load pagination_tags %}
{% load privacy_tags %}
{% load projects_tags %}

{% block title %}Builds{% endblock %}

{% block project_editing %}
    {% with builds_active="active" %}
        {% include "core/project_bar.html" %}
    {% endwith %}
{% endblock %}

{% block content %}


<div id="build_list">

        {% autopaginate build_qs 15 %}

        <!-- BEGIN builds list -->
        <div class="module">
          <div class="module-wrapper">

            {% block build_versions %}
            {% if versions and request.user|is_admin:project %}
            <div class="module-header">
              <div style="float:right;">
                <form method="post" action="{% url "builds_project_list" project.slug %}">
                  {% csrf_token %}
                  <ul class="build_a_version">
                    <li style="display: inline-block">
                      <input style="display: inline-block" type="submit" value="{% trans "Build Version:" %}">
                    </li>
                    <li style="display: inline-block">
                      <select id="id_version" name="version_slug">
                      {% for version in versions|sort_version_aware %}
                        <option value="{{ version.slug }}">{{ version.slug }}</option>
                      {% endfor %}
                      </select>
                    </li>
                  </ul>
                </form>
              </div>
            </div>
            {% endif %}
            {% endblock %}

              <h1>{% trans "Recent Builds" %}</h1>
            </div>

            <div class="module-list">
              <div class="module-list-wrapper">
                <ul>
                  {% include "core/build_list_detailed.html" %}
                </ul>
              </div>
            </div>

          </div>
        </div>
        <!-- END builds list -->

        {% paginate %}

</div>

{% endblock %}

{% comment %}

{% block extra_scripts %}
{{ block.super }}
  <script type="text/javascript" src="{% static 'javascript/build_updater.js' %}"></script>

  <script type="text/javascript">
    $(function() {
      {% for build in active_builds %}
        $('#build-{{ build.id }}').effect('highlight', {}, 3000);
        new BuildListUpdater({{ build.id }}).startPolling();
      {% endfor %}
    });
  </script>
{% endblock %}

{% endcomment %}
